<template>
	<view class="appraise-content">
		<view class="top-appraise">
			<view class="title-number">4.9</view>
			<view class="top-item">
				<text>{{$t('MerchantRatings')}}</text>
				<u-rate :count="count" readonly active-color="#ffa902" gutter="1" inactive-color="#b2b2b2"
					v-model="value"></u-rate>
			</view>
			<view class="top-item">
				<text>{{$t('Flavor')}}</text>
				<view class="number">4.9</view>
			</view>
			<view class="top-item">
				<text>{{$t('Wrap')}}</text>
				<view class="number">4.9</view>
			</view>
			<view class="" style="border-right: 2rpx solid  #cecfd1;height:90%"></view>
			<view class="top-item">
				<text>{{$t('DeliveryRate')}}</text>
				<view class="number">100%</view>
			</view>
		</view>
		<view class="appraise-menu" :style="{direction:i18nLocale=='ug'?'rtl':''}">
			<view :class="ac_menu==index?'item acitem':'item'" v-for="(item,index) in menuList" :key="index"
				@click="selecetmenu(index)">
				{{$t(item.title)}}({{item.number}})
			</view>
		</view>
		<view class="appraise-list" :style="{direction:i18nLocale=='ug'?'rtl':''}">
			<u-empty v-if="appraiseList.length==0" style="padding-top: 200rpx;" icon="../../static/images/comment.png" mode="comment" :text="$t('EmptyComment')"
				iconSize="100" textSize="14">
			</u-empty>
			<scroll-view scroll-y="true" v-if="appraiseList.length" style="width:100%;height:100%;">
				<view class="appraise-item"  v-for="(item,index) in appraiseList" :key="index">
					<view class="left">
						<u-icon name="account-fill" color="#cecfd1" size="60"></u-icon>
						<view class="user-content">
							<view class="content">{{item.content}}</view>
							<view class="user">
								<text>{{item.name}}:</text>
								<u-rate :count="count" size="20" readonly active-color="#ffa902" gutter="0"
									inactive-color="#b2b2b2" v-model="item.value"></u-rate>
							</view>
						</view>
					</view>
					<view class="right">
						<view class="time">{{item.time}}</view>
						<view class="shopname">{{item.shopname}}</view>
					</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {

		},
		props: {
			current: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
				address: '',
				count: 5,
				value: 5,
				ac_menu: 0,
				menuList: [{
						title: 'All',
						number: 0,
					},
					{
						title: 'Good',
						number: 0,
					},
					{
						title: 'Difference',
						number: 0,
					},

				],
				appraiseList: []

			};
		},
		computed: {
			i18nLocale() {
				return this.$i18n.locale;
			},
		},
		mounted() {

		},
		methods: {
			selecetmenu(index) {
				this.ac_menu = index;
			}
		}

	}
</script>

<style lang="scss" scoped>
	.appraise-content {
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;

		.top-appraise {
			width: 100%;
			display: flex;
			justify-content: space-around;
			align-items: center;
			box-sizing: border-box;
			padding: 10rpx 0rpx;
			background-color: #fff;
			border-top: 2rpx solid #cecfd1;

			.title-number {
				color: #ff7f00;
				font-size: 50rpx;
			}

			.top-item {
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				align-items: center;
				font-size: $uni-font-size-paragraph;

				text {
					color: $uni-text-color-grey;
					padding-bottom: 10rpx;
				}

				.number {
					color: #695174;
					font-size: $uni-font-size-paragraph;

				}
			}
		}

		.appraise-menu {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-around;
			align-items: center;
			background-color: #fff;
			margin-top: 25rpx;
			padding: 20rpx 10rpx;
			box-sizing: border-box;


			.item {
				background-color: #e1f7ea;
				border-radius: 40rpx;
				color: $uni-color-topic;
				display: flex;
				justify-content: center;
				align-items: center;
				padding: 10rpx 20rpx;
				font-size: $uni-font-size-base;
			}

			.acitem {
				background-color: $uni-color-topic;
				color: #fff;
			}

		}

		.appraise-list {
			width:100%;
			height: calc(100% - 196rpx);
			box-sizing: border-box;
			.appraise-item {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 30rpx 20rpx;
				box-sizing: border-box;
				border-top: 1rpx solid $uni-border-color;

				.left {
					flex: 2;
					display: flex;
					align-items: center;

					.user-content {
						padding: 0rpx 20rpx;

						.user {
							display: flex;
							padding-top: 20rpx;
						}
					}
				}

				.right {
					flex: 1;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					align-items: center;

					.time {
						font-size: 25rpx;
						padding-bottom: 20rpx;
						color: #c1aea5;
					}

					.shopname {
						color: $uni-color-topic;
					}
				}
			}
		}
	}
</style>